<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenShoe: spi_master.h File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenShoe
   &#160;<span id="projectnumber">0.1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">spi_master.h File Reference</div>  </div>
</div>
<div class="contents">

<p>SPI Master driver for AVR UC3.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="compiler_8h_source.html">compiler.h</a>&quot;</code><br/>
<code>#include &quot;sysclk.h&quot;</code><br/>
<code>#include &quot;<a class="el" href="status__codes_8h_source.html">status_codes.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="spi_8h_source.html">spi.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="conf__spi__master_8h_source.html">conf_spi_master.h</a>&quot;</code><br/>
</div>
<p><a href="uc3__spi_2spi__master_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structspi__device.html">spi_device</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Polled SPI device defintion.  <a href="structspi__device.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Spi Master Management Configuration</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="uc3__spi_2spi__master_8h.html#a2e703725551c981e6c53c149d179b5ea">CONFIG_SPI_MASTER_DELAY_BCS</a>&#160;&#160;&#160;0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Default Config Spi Master Delay BCS.  <a href="#a2e703725551c981e6c53c149d179b5ea"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="uc3__spi_2spi__master_8h.html#ae8f69c3f97cc5f256da40ea4009ed004">CONFIG_SPI_MASTER_BITS_PER_TRANSFER</a>&#160;&#160;&#160;8</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Default Config Spi Master Bits per Transfer Definition.  <a href="#ae8f69c3f97cc5f256da40ea4009ed004"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="uc3__spi_2spi__master_8h.html#a9191538dc45075e8db54b0ce71854830">CONFIG_SPI_MASTER_DELAY_BCT</a>&#160;&#160;&#160;0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Default Config Spi Master Delay BCT.  <a href="#a9191538dc45075e8db54b0ce71854830"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="uc3__spi_2spi__master_8h.html#acf9c81ee4bbe25a4f7ce9323950df30a">CONFIG_SPI_MASTER_DELAY_BS</a>&#160;&#160;&#160;0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Default Config Spi Master Delay BS.  <a href="#acf9c81ee4bbe25a4f7ce9323950df30a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="uc3__spi_2spi__master_8h.html#a64f5ff62d19aab1a97cc5e72e062be49">CONFIG_SPI_MASTER_DUMMY</a>&#160;&#160;&#160;0xFF</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Default Config Spi Master Dummy Field.  <a href="#a64f5ff62d19aab1a97cc5e72e062be49"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="uc3__spi_2spi__master_8h.html#a781db101a4c4490735eb12d3cb92fde7">spi_flags_t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Spi Flags definition.  <a href="#a781db101a4c4490735eb12d3cb92fde7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="uc3__spi_2spi__master_8h.html#a0216987e3f93d6bd7392bb7f28c3db2c">board_spi_select_id_t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Board Spi Select Id Definition.  <a href="#a0216987e3f93d6bd7392bb7f28c3db2c"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="uc3__spi_2spi__master_8h.html#adb8e173ada01040ae56a5f5868b50449">spi_master_setup_device</a> (volatile avr32_spi_t *spi, struct <a class="el" href="structspi__device.html">spi_device</a> *device, <a class="el" href="uc3__spi_2spi__master_8h.html#a781db101a4c4490735eb12d3cb92fde7">spi_flags_t</a> flags, uint32_t baud_rate, <a class="el" href="uc3__spi_2spi__master_8h.html#a0216987e3f93d6bd7392bb7f28c3db2c">board_spi_select_id_t</a> sel_id)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Setup a SPI device.  <a href="#adb8e173ada01040ae56a5f5868b50449"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="uc3__spi_2spi__master_8h.html#ac93e5990e8abc811f4ba2fb65e10e94d">spi_enable</a> (volatile avr32_spi_t *spi)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the SPI.  <a href="#ac93e5990e8abc811f4ba2fb65e10e94d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="uc3__spi_2spi__master_8h.html#a5cc4ac60e6ecf3cdc442265aaa0a63e0">spi_disable</a> (volatile avr32_spi_t *spi)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables the SPI.  <a href="#a5cc4ac60e6ecf3cdc442265aaa0a63e0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="uc3__spi_2spi__master_8h.html#aa945d35a658c234e2cb650a53dcdaa37">spi_is_enabled</a> (volatile avr32_spi_t *spi)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Tests if the SPI is enabled.  <a href="#aa945d35a658c234e2cb650a53dcdaa37"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="status__codes_8h.html#a1f12e07903f974729de22ebe2f52273e">status_code_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="uc3__spi_2spi__master_8h.html#a5eea18b25801b83f702f8ff49cfebc54">spi_write_packet</a> (volatile avr32_spi_t *spi, const uint8_t *data, size_t len)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Send a sequence of bytes to a SPI device.  <a href="#a5eea18b25801b83f702f8ff49cfebc54"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="status__codes_8h.html#a1f12e07903f974729de22ebe2f52273e">status_code_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="uc3__spi_2spi__master_8h.html#aafdacdffa212b9880873c82b0fb6d8e7">spi_read_packet</a> (volatile avr32_spi_t *spi, uint8_t *data, size_t len)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Receive a sequence of bytes from a SPI device.  <a href="#aafdacdffa212b9880873c82b0fb6d8e7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="uc3__spi_2spi__master_8h.html#a7a08995ae2193f27979fdd0613f3f189">spi_is_tx_empty</a> (volatile avr32_spi_t *spi)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if all transmissions are complete.  <a href="#a7a08995ae2193f27979fdd0613f3f189"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="uc3__spi_2spi__master_8h.html#afc0784fc74e3a9c6bbf5de5aa87a413f">spi_is_tx_ready</a> (volatile avr32_spi_t *spi)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if all transmissions is ready.  <a href="#afc0784fc74e3a9c6bbf5de5aa87a413f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="uc3__spi_2spi__master_8h.html#a8ec4bf90b5b8de62f3ce6aae2fdfa752">spi_is_rx_full</a> (volatile avr32_spi_t *spi)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if the SPI contains a received character.  <a href="#a8ec4bf90b5b8de62f3ce6aae2fdfa752"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="uc3__spi_2spi__master_8h.html#aa137d54c8ea3799cf6f2b2c710569be6">spi_is_rx_ready</a> (volatile avr32_spi_t *spi)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if all reception is ready.  <a href="#aa137d54c8ea3799cf6f2b2c710569be6"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>SPI Master driver for AVR UC3. </p>
<p>This file defines a useful set of functions for the SPI interface on AVR UC3 devices.</p>
<ul>
<li>Compiler: IAR EWAVR32 and GNU GCC for AVR UC3</li>
<li>Supported devices: All AVR UC3 devices with an SPI module can be used.</li>
<li>AppNote:</li>
</ul>
<dl class="author"><dt><b>Author:</b></dt><dd>Atmel Corporation: <a href="http://www.atmel.com">http://www.atmel.com</a> <br/>
 Support and FAQ: <a href="http://support.atmel.no/">http://support.atmel.no/</a> </dd></dl>
</div><hr/><h2>Define Documentation</h2>
<a class="anchor" id="ae8f69c3f97cc5f256da40ea4009ed004"></a><!-- doxytag: member="uc3_spi/spi_master.h::CONFIG_SPI_MASTER_BITS_PER_TRANSFER" ref="ae8f69c3f97cc5f256da40ea4009ed004" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define CONFIG_SPI_MASTER_BITS_PER_TRANSFER&#160;&#160;&#160;8</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Default Config Spi Master Bits per Transfer Definition. </p>

</div>
</div>
<a class="anchor" id="a2e703725551c981e6c53c149d179b5ea"></a><!-- doxytag: member="uc3_spi/spi_master.h::CONFIG_SPI_MASTER_DELAY_BCS" ref="a2e703725551c981e6c53c149d179b5ea" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define CONFIG_SPI_MASTER_DELAY_BCS&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Default Config Spi Master Delay BCS. </p>

</div>
</div>
<a class="anchor" id="a9191538dc45075e8db54b0ce71854830"></a><!-- doxytag: member="uc3_spi/spi_master.h::CONFIG_SPI_MASTER_DELAY_BCT" ref="a9191538dc45075e8db54b0ce71854830" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define CONFIG_SPI_MASTER_DELAY_BCT&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Default Config Spi Master Delay BCT. </p>

</div>
</div>
<a class="anchor" id="acf9c81ee4bbe25a4f7ce9323950df30a"></a><!-- doxytag: member="uc3_spi/spi_master.h::CONFIG_SPI_MASTER_DELAY_BS" ref="acf9c81ee4bbe25a4f7ce9323950df30a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define CONFIG_SPI_MASTER_DELAY_BS&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Default Config Spi Master Delay BS. </p>

</div>
</div>
<a class="anchor" id="a64f5ff62d19aab1a97cc5e72e062be49"></a><!-- doxytag: member="uc3_spi/spi_master.h::CONFIG_SPI_MASTER_DUMMY" ref="a64f5ff62d19aab1a97cc5e72e062be49" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define CONFIG_SPI_MASTER_DUMMY&#160;&#160;&#160;0xFF</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Default Config Spi Master Dummy Field. </p>

</div>
</div>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="a0216987e3f93d6bd7392bb7f28c3db2c"></a><!-- doxytag: member="uc3_spi/spi_master.h::board_spi_select_id_t" ref="a0216987e3f93d6bd7392bb7f28c3db2c" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef uint8_t <a class="el" href="uc3__spi_2spi__master_8h.html#a0216987e3f93d6bd7392bb7f28c3db2c">board_spi_select_id_t</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Board Spi Select Id Definition. </p>

</div>
</div>
<a class="anchor" id="a781db101a4c4490735eb12d3cb92fde7"></a><!-- doxytag: member="uc3_spi/spi_master.h::spi_flags_t" ref="a781db101a4c4490735eb12d3cb92fde7" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef uint8_t <a class="el" href="uc3__spi_2spi__master_8h.html#a781db101a4c4490735eb12d3cb92fde7">spi_flags_t</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Spi Flags definition. </p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a5cc4ac60e6ecf3cdc442265aaa0a63e0"></a><!-- doxytag: member="uc3_spi/spi_master.h::spi_disable" ref="a5cc4ac60e6ecf3cdc442265aaa0a63e0" args="(volatile avr32_spi_t *spi)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void spi_disable </td>
          <td>(</td>
          <td class="paramtype">volatile avr32_spi_t *&#160;</td>
          <td class="paramname"><em>spi</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Disables the SPI. </p>
<p>Ensures that nothing is transferred while setting up buffers.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">spi</td><td>Base address of the SPI instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="warning"><dt><b>Warning:</b></dt><dd>This may cause data loss if used on a slave SPI. </dd></dl>

</div>
</div>
<a class="anchor" id="ac93e5990e8abc811f4ba2fb65e10e94d"></a><!-- doxytag: member="uc3_spi/spi_master.h::spi_enable" ref="ac93e5990e8abc811f4ba2fb65e10e94d" args="(volatile avr32_spi_t *spi)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void spi_enable </td>
          <td>(</td>
          <td class="paramtype">volatile avr32_spi_t *&#160;</td>
          <td class="paramname"><em>spi</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Enables the SPI. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">spi</td><td>Base address of the SPI instance. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aa945d35a658c234e2cb650a53dcdaa37"></a><!-- doxytag: member="uc3_spi/spi_master.h::spi_is_enabled" ref="aa945d35a658c234e2cb650a53dcdaa37" args="(volatile avr32_spi_t *spi)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int spi_is_enabled </td>
          <td>(</td>
          <td class="paramtype">volatile avr32_spi_t *&#160;</td>
          <td class="paramname"><em>spi</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Tests if the SPI is enabled. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">spi</td><td>Base address of the SPI instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><code>1</code> if the SPI is enabled, otherwise <code>0</code>. </dd></dl>

</div>
</div>
<a class="anchor" id="a8ec4bf90b5b8de62f3ce6aae2fdfa752"></a><!-- doxytag: member="uc3_spi/spi_master.h::spi_is_rx_full" ref="a8ec4bf90b5b8de62f3ce6aae2fdfa752" args="(volatile avr32_spi_t *spi)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool spi_is_rx_full </td>
          <td>(</td>
          <td class="paramtype">volatile avr32_spi_t *&#160;</td>
          <td class="paramname"><em>spi</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Check if the SPI contains a received character. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">spi</td><td>Base address of the SPI instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><code>1</code> if the SPI Receive Holding Register is full, otherwise <code>0</code>. </dd></dl>

</div>
</div>
<a class="anchor" id="aa137d54c8ea3799cf6f2b2c710569be6"></a><!-- doxytag: member="uc3_spi/spi_master.h::spi_is_rx_ready" ref="aa137d54c8ea3799cf6f2b2c710569be6" args="(volatile avr32_spi_t *spi)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool spi_is_rx_ready </td>
          <td>(</td>
          <td class="paramtype">volatile avr32_spi_t *&#160;</td>
          <td class="paramname"><em>spi</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Checks if all reception is ready. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">spi</td><td>Base address of the SPI instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><code>1</code> if the SPI Receiver is ready, otherwise <code>0</code>. </dd></dl>

</div>
</div>
<a class="anchor" id="a7a08995ae2193f27979fdd0613f3f189"></a><!-- doxytag: member="uc3_spi/spi_master.h::spi_is_tx_empty" ref="a7a08995ae2193f27979fdd0613f3f189" args="(volatile avr32_spi_t *spi)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool spi_is_tx_empty </td>
          <td>(</td>
          <td class="paramtype">volatile avr32_spi_t *&#160;</td>
          <td class="paramname"><em>spi</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Checks if all transmissions are complete. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">spi</td><td>Base address of the SPI instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Status. </dd></dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">1</td><td>All transmissions complete. </td></tr>
    <tr><td class="paramname">0</td><td>Transmissions not complete. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="afc0784fc74e3a9c6bbf5de5aa87a413f"></a><!-- doxytag: member="uc3_spi/spi_master.h::spi_is_tx_ready" ref="afc0784fc74e3a9c6bbf5de5aa87a413f" args="(volatile avr32_spi_t *spi)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool spi_is_tx_ready </td>
          <td>(</td>
          <td class="paramtype">volatile avr32_spi_t *&#160;</td>
          <td class="paramname"><em>spi</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Checks if all transmissions is ready. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">spi</td><td>Base address of the SPI instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Status. </dd></dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">1</td><td>All transmissions complete. </td></tr>
    <tr><td class="paramname">0</td><td>Transmissions not complete. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="adb8e173ada01040ae56a5f5868b50449"></a><!-- doxytag: member="uc3_spi/spi_master.h::spi_master_setup_device" ref="adb8e173ada01040ae56a5f5868b50449" args="(volatile avr32_spi_t *spi, struct spi_device *device, spi_flags_t flags, uint32_t baud_rate, board_spi_select_id_t sel_id)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void spi_master_setup_device </td>
          <td>(</td>
          <td class="paramtype">volatile avr32_spi_t *&#160;</td>
          <td class="paramname"><em>spi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structspi__device.html">spi_device</a> *&#160;</td>
          <td class="paramname"><em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="uc3__spi_2spi__master_8h.html#a781db101a4c4490735eb12d3cb92fde7">spi_flags_t</a>&#160;</td>
          <td class="paramname"><em>flags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>baud_rate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="uc3__spi_2spi__master_8h.html#a0216987e3f93d6bd7392bb7f28c3db2c">board_spi_select_id_t</a>&#160;</td>
          <td class="paramname"><em>sel_id</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Setup a SPI device. </p>
<p>The returned device descriptor structure must be passed to the driver whenever that device should be used as current slave device.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">spi</td><td>Base address of the SPI instance. </td></tr>
    <tr><td class="paramname">device</td><td>Pointer to SPI device struct that should be initialized. </td></tr>
    <tr><td class="paramname">flags</td><td>SPI configuration flags. Common flags for all implementations are the SPI modes SPI_MODE_0 ... SPI_MODE_3. </td></tr>
    <tr><td class="paramname">baud_rate</td><td>Baud rate for communication with slave device in Hz. </td></tr>
    <tr><td class="paramname">sel_id</td><td>Board specific seclet id </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aafdacdffa212b9880873c82b0fb6d8e7"></a><!-- doxytag: member="uc3_spi/spi_master.h::spi_read_packet" ref="aafdacdffa212b9880873c82b0fb6d8e7" args="(volatile avr32_spi_t *spi, uint8_t *data, size_t len)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="status__codes_8h.html#a1f12e07903f974729de22ebe2f52273e">status_code_t</a> spi_read_packet </td>
          <td>(</td>
          <td class="paramtype">volatile avr32_spi_t *&#160;</td>
          <td class="paramname"><em>spi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Receive a sequence of bytes from a SPI device. </p>
<p>All bytes sent out on SPI bus are sent as value 0.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">spi</td><td>Base address of the SPI instance. </td></tr>
    <tr><td class="paramname">data</td><td>Data buffer to read </td></tr>
    <tr><td class="paramname">len</td><td>Length of data</td></tr>
  </table>
  </dd>
</dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>SPI device must be selected with spi_select_device() first </dd></dl>

</div>
</div>
<a class="anchor" id="a5eea18b25801b83f702f8ff49cfebc54"></a><!-- doxytag: member="uc3_spi/spi_master.h::spi_write_packet" ref="a5eea18b25801b83f702f8ff49cfebc54" args="(volatile avr32_spi_t *spi, const uint8_t *data, size_t len)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="status__codes_8h.html#a1f12e07903f974729de22ebe2f52273e">status_code_t</a> spi_write_packet </td>
          <td>(</td>
          <td class="paramtype">volatile avr32_spi_t *&#160;</td>
          <td class="paramname"><em>spi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Send a sequence of bytes to a SPI device. </p>
<p>Received bytes on the SPI bus are discarded.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">spi</td><td>Base address of the SPI instance. </td></tr>
    <tr><td class="paramname">data</td><td>Data buffer to write </td></tr>
    <tr><td class="paramname">len</td><td>Length of data</td></tr>
  </table>
  </dd>
</dl>
<dl class="pre"><dt><b>Precondition:</b></dt><dd>SPI device must be selected with spi_select_device() first </dd></dl>

</div>
</div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Mon Dec 19 2011 21:04:53 for OpenShoe by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
